<?php

	/*
	 * 
	 * Reg expression to get different fields from pages 
	 * 
 	 * @author Andrew (Jun Gu), Bo
 	 */

	/*
	 * ========================================================
	 * Add Shop Status
	 * ========================================================
	 */
	define("ADDSHOP_STATUS_SUCCESS",1);
	define("ADDSHOP_STATUS_MISS_KEY_DATA",2);
	define("ADDSHOP_STATUS_MISS_REG_DATA",3);	
	define("ADDSHOP_STATUS_MISS_TAOBAOAPI_DATA",4);	
	define("ADDSHOP_STATUS_UNKOWNN_PLATFORM",5);
	define("SHOP_FORBIDDEN", 9);

	/*
	 * ========================================================
	 * Taobao --- Shop
	 * ========================================================
	 */

	define("TAOBAO_ENCODING","GBK");
	
	define("TAOBAO_SHOP_URL","/http:\/\/shop[0-9]+\.taobao\.com\S*/");
	define("TAOBAO_URL_SHOPID","/shop([0-9]+)\.taobao/");
	
	define("TAOBAO_MALL", "/" . mb_convert_encoding("天猫Tmall.com", TAOBAO_ENCODING, "auto") . "/");
	
	define("TAOBAO_NICK_NAME","/class=\"hCard fn\"\s*href=\"\S*\">(.+)<\/a>/");
	define("TAOBAO_MALL_NICK_NAME","/".mb_convert_encoding("柜：",TAOBAO_ENCODING,"auto")."<\/label>\s*<a\s*href=\"\S*\">(.+)<\/a>/");

	define("TAOBAO_LOCATION","/<span>".mb_convert_encoding("所在地区：",TAOBAO_ENCODING,"auto")."<\/span>\s*(.+)\s*<\/li>/");
	define("TAOBAO_MALL_LOCATION","/<li class=\"locus\">\s*<span>".mb_convert_encoding("所在地：",TAOBAO_ENCODING,"auto")."<\/span>\s*(.+)\s*<\/li>/");
	
	define("TAOBAO_MALL_LOGO","http://pics.taobao.com/bao/album/wp/bc_shop_icon.png");
	define('TAOBAO_PIC_PREFIX','http://logo.taobao.com/shop-logo');		

	define('TAOBAOKE_ID','10176789');
	define('TAOBAO_API_URL','http://gw.api.taobao.com/router/rest?');	
	define('TAOBAO_API_TEST_URL','http://gw.api.tbsandbox.com/router/rest?');		
	define('TAOBAO_APP_KEY','21014814');
	define('TAOBAO_APP_SECRET','f4d441766dd87878f6e6c520a95b2c6e');
	/*
	 * ========================================================
	 * Eachnet --- Shop
	 * ========================================================
	 */

	define("EACHNET_ENCODING","utf-8");
	
	//从html得到 productID  
	define("EACHNET_CONTENT_SHOPID","/shopId\s*=\s*([0-9]+)\s*/");	
	
	define("EACHNET_SHOP_NAME","/<strong>(.+)<\/strong>/");
	
	define("EACHNET_NICK_NAME","/<dt>".mb_convert_encoding("易趣卖家：",EACHNET_ENCODING,"auto")."<\/dt>\s*<dd>(.+)<\/dd>/");
	
	define("EACHNET_CREATED_DATE","/<dt>".mb_convert_encoding("创店日期：",EACHNET_ENCODING,"auto")."<\/dt>\s*<dd>(\S+)<\/dd>/");
	
	define("EACHNET_LOGO_URL","/<img\s*title=\"\S*\"\s*src=\"(http:\/\/\S*)\"/");
	
	define("EACHNET_LOCATION","");
	
	/*
	 * ========================================================
	 * Paipai --- Shop
	 * ========================================================
	 */
	
	define("PAIPAI_ENCODING","gb2312");
	
	//从html得到 productID  
	define("PAIPAI_CONTENT_SHOPID","/([0-9]{5,})\.paipai\.com/");	
	
	define("PAIPAI_SHOP_NAME","/<li\s*class=\"shopname\">(.+)<\/li>/");
	
	define("PAIPAI_LOCATION","/<li>\s*".mb_convert_encoding("所 在 地：",PAIPAI_ENCODING,"auto")."(.+)\s*<\/li>/");
	

	/*
	 * ========================================================
	 * youa --- Shop
	 * ========================================================
	 */
	
	define("YOUA_ENCODING","gb2312");

	//从html得到 productID  
	define("YOUA_CONTENT_SHOPID","/favo_obj_id=\"(\S+)\"/");
	
	define("YOUA_SHOP_NAME","/title>(.+)".mb_convert_encoding("_百度有啊",YOUA_ENCODING,"auto")."<\/title>/");
	
	define("YOUA_NICK_NAME","/uname=\"(.+)\"/");
	
	define("YOUA_CREATED_DATE","/".mb_convert_encoding("创店时间：",YOUA_ENCODING,"auto")."\s*<\/label>\s*<span\s*class=\"v\">(.+)<\/span>/");
	
	define("YOUA_LOGO_URL","/<p\s*class=\"img\">\s*<img\s*src=\"(http:\/\/\S*)\"\s*alt/");
	
	define("YOUA_LOCATION","/".mb_convert_encoding("地：",YOUA_ENCODING,"auto")."\s*<\/label>\s*<span\s*class=\"v\">(.+)<\/span>/");
	

		

		
	
	
	
?>